<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>Home</title>
		<!-- Tell the browser to be responsive to screen width -->
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<!-- Font Awesome -->
		<link rel="stylesheet" href="../../plugins/font-awesome/css/font-awesome.min.css">
		<!-- Ionicons -->
		<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
		<!-- Theme style -->
		<link rel="stylesheet" href="../../dist/css/adminlte.min.css">
		<!-- iCheck -->
		<link rel="stylesheet" href="../../plugins/iCheck/flat/blue.css">
		<!-- Morris chart -->
		<link rel="stylesheet" href="../../plugins/morris/morris.css">
		<!-- jvectormap -->
		<link rel="stylesheet" href="../../plugins/jvectormap/jquery-jvectormap-1.2.2.css">
		<!-- Date Picker -->
		<link rel="stylesheet" href="../../plugins/datepicker/datepicker3.css">
		<!-- Daterange picker -->
		<link rel="stylesheet" href="../../plugins/daterangepicker/daterangepicker-bs3.css">
		<!-- bootstrap wysihtml5 - text editor -->
		<link rel="stylesheet" href="../../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
		<!-- Google Font: Source Sans Pro -->
		<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
		<!-- DataTables -->
		<link rel="stylesheet" href="../../plugins/datatables/dataTables.bootstrap4.css">
	</head>

	<body class="hold-transition sidebar-mini">
		<div class="wrapper">

			<!-- Navbar -->
			<nav class="main-header navbar navbar-expand bg-white navbar-light border-bottom">
				<!-- Left navbar links -->
				<ul class="navbar-nav">
					<li class="nav-item">
						<a class="nav-link" data-widget="pushmenu" href="#"><i class="fa fa-bars"></i></a>
					</li>
				<!--	<li class="nav-item d-none d-sm-inline-block">
						<a href="../../index3.html" class="nav-link">Home</a>
					</li>-->
					<li class="nav-item d-none d-sm-inline-block">
						<a href="../LH_PM/UserLogin.html"  class="nav-link">切换账号</a>
					</li>
				</ul>

				<!-- SEARCH FORM -->
				<form class="form-inline ml-3">
					<div class="input-group input-group-sm">
						<input class="form-control form-control-navbar" id="search" type="search" placeholder="订单查询" aria-label="订单查询">
						<div class="input-group-append">
							<button class="btn btn-navbar" onclick="myCart()" type="button">
                            <i class="fa fa-search"></i>
                            </button>
						</div>
					</div>
				</form>

				<!-- Right navbar links -->
				<ul class="navbar-nav ml-auto">
					<!-- Messages Dropdown Menu -->
					<li class="nav-item dropdown">
						<a class="nav-link" data-toggle="dropdown" href="#">
							<i class="fa fa-comments-o"></i>
							<span class="badge badge-danger navbar-badge">3</span>
						</a>
						<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
							<a href="#" class="dropdown-item">
								<!-- Message Start -->
								<div class="media">
									<img src="../../dist/img/user1-128x128.jpg" alt="User Avatar" class="img-size-50 mr-3 img-circle">
									<div class="media-body">
										<h3 class="dropdown-item-title">
                  Brad Diesel
                  <span class="float-right text-sm text-danger"><i class="fa fa-star"></i></span>
                </h3>
										<p class="text-sm">Call me whenever you can...</p>
										<p class="text-sm text-muted"><i class="fa fa-clock-o mr-1"></i> 4 Hours Ago</p>
									</div>
								</div>
								<!-- Message End -->
							</a>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item">
								<!-- Message Start -->
								<div class="media">
									<img src="../../dist/img/user8-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
									<div class="media-body">
										<h3 class="dropdown-item-title">
                  John Pierce
                  <span class="float-right text-sm text-muted"><i class="fa fa-star"></i></span>
                </h3>
										<p class="text-sm">I got your message bro</p>
										<p class="text-sm text-muted"><i class="fa fa-clock-o mr-1"></i> 4 Hours Ago</p>
									</div>
								</div>
								<!-- Message End -->
							</a>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item">
								<!-- Message Start -->
								<div class="media">
									<img src="../../dist/img/user3-128x128.jpg" alt="User Avatar" class="img-size-50 img-circle mr-3">
									<div class="media-body">
										<h3 class="dropdown-item-title">
                  Nora Silvester
                  <span class="float-right text-sm text-warning"><i class="fa fa-star"></i></span>
                </h3>
										<p class="text-sm">The subject goes here</p>
										<p class="text-sm text-muted"><i class="fa fa-clock-o mr-1"></i> 4 Hours Ago</p>
									</div>
								</div>
								<!-- Message End -->
							</a>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
						</div>
					</li>
					<!-- Notifications Dropdown Menu -->
					<li class="nav-item dropdown">
						<a class="nav-link" data-toggle="dropdown" href="#">
							<i class="fa fa-bell-o"></i>
							<span class="badge badge-warning navbar-badge">15</span>
						</a>
						<div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
							<span class="dropdown-item dropdown-header">15 Notifications</span>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item">
								<i class="fa fa-envelope mr-2"></i> 4 new messages
								<span class="float-right text-muted text-sm">3 mins</span>
							</a>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item">
								<i class="fa fa-users mr-2"></i> 8 friend requests
								<span class="float-right text-muted text-sm">12 hours</span>
							</a>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item">
								<i class="fa fa-file mr-2"></i> 3 new reports
								<span class="float-right text-muted text-sm">2 days</span>
							</a>
							<div class="dropdown-divider"></div>
							<a href="#" class="dropdown-item dropdown-footer">See All Notifications</a>
						</div>
					</li>
					<li class="nav-item">
						<a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#"><i class="fa fa-th-large"></i></a>
					</li>
				</ul>
			</nav>
			<!-- /.navbar -->

			<!-- Main Sidebar Container -->
			<aside class="main-sidebar sidebar-dark-primary elevation-4">
				<!-- Brand Logo -->
				<a href="Home.html" class="brand-link">
					<img src="../../dist/img/Log.jpg" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
					<span class="brand-text font-weight-light">Good_Logistics</span>
				</a>

				<!-- Sidebar -->
				<div class="sidebar">
					<!-- Sidebar user panel (optional) -->
					<div class="user-panel mt-3 pb-3 mb-3 d-flex">
						<div class="image">
							<img src="../../dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
						</div>
						<div class="info">
							<a href="#" class="d-block" id="d-block">Alexander Pierce</a>
						</div>
					</div>

					<!-- Sidebar Menu -->
					<nav class="mt-2">
						<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
							<!-- Add icons to the links using the .nav-icon class
                             with font-awesome or any other icon font library -->
							<li class="nav-item has-treeview">
								<a href="#" class="nav-link">
									<i class="nav-icon fa fa-pie-chart"></i>
									<p>
										功能区
										<i class="right fa fa-angle-left"></i>
									</p>
								</a>
								<ul class="nav nav-treeview">

									<li class="nav-item">
										<a href="#" class="nav-link">
											<i class="right fa fa-angle-left"></i>
											<p>待接收订单管理</p>
										</a>
										<ul class="nav nav-treeview">
											<li onclick="showOrderManagement()" class="nav-item">
												<a href="#" class="nav-link">
													<i class="fa fa-circle-o nav-icon"></i>
													<p>营业厅订单管理</p>
												</a>
											</li>
											<li class="nav-item" onclick="showTransitofsingleOrderManagement()">
												<a href="#" class="nav-link">
													<i class="fa fa-circle-o nav-icon"></i>
													<p>中转站订单管理</p>
												</a>
											</li>

										</ul>

									</li>
									<li class="nav-item">
										<a href="#" class="nav-link">
											<i class="right fa fa-angle-left"></i>
											<p>已到达订单管理</p>
										</a>
										<ul class="nav nav-treeview">

											<li class="nav-item" onclick="show_Takestockofcargoinformation()">
												<a href="#" class="nav-link">
													<i class="fa fa-circle-o nav-icon"></i>
													<p>盘点货物信息</p>
												</a>
											</li>
											<li class="nav-item" onclick="Show_Transitofsingle()">
												<a href="#" class="nav-link">
													<i class="fa fa-circle-o nav-icon"></i>
													<p>查看中转订单</p>
												</a>
											</li>
											<li class="nav-item" onclick="Show_Tloading()">
												<a href="#" class="nav-link">
													<i class="fa fa-circle-o nav-icon"></i>
													<p>查看装运订单</p>
												</a>
											</li>

										</ul>
									</li>

								</ul>
							</li>
						</ul>
					</nav>
					<!-- /.sidebar-menu -->
				</div>
				<!-- /.sidebar -->
			</aside>

			<!-- Content Wrapper. Contains page content -->
			<div class="content-wrapper">
				<br />
				<!-- Info boxes -->
				<div class="row">
					<div class="col-12 col-sm-6 col-md-3">
						<div class="info-box">
							<span class="info-box-icon bg-info elevation-1"><i class="fa fa-gear"></i></span>

							<div class="info-box-content">
								<span class="info-box-text">待处理订单</span>
								<span class="info-box-number" id="pending">0
                               
                                </span>
							</div>
							<!-- /.info-box-content -->
						</div>
						<!-- /.info-box -->
					</div>
					<!-- /.col -->
					<div class="col-12 col-sm-6 col-md-3">
						<div class="info-box mb-3">
							<span class="info-box-icon bg-danger elevation-1"><i class="fa fa-google-plus"></i></span>

							<div class="info-box-content">
								<span class="info-box-text">未处理订单</span>
								<span class="info-box-number" id="reached">0</span>
							</div>
							<!-- /.info-box-content -->
						</div>
						<!-- /.info-box -->
					</div>
					<!-- /.col -->

					<!-- fix for small devices only -->
					<div class="clearfix hidden-md-up"></div>

					<div class="col-12 col-sm-6 col-md-3">
						<div class="info-box mb-3">
							<span class="info-box-icon bg-success elevation-1"><i class="fa fa-shopping-cart"></i></span>

							<div class="info-box-content">
								<span class="info-box-text">已处理订单</span>
								<span class="info-box-number" id="arrive">0</span>
							</div>
							<!-- /.info-box-content -->
						</div>
						<!-- /.info-box -->
					</div>
					<!-- /.col -->
					<div class="col-12 col-sm-6 col-md-3">
						<div class="info-box mb-3">
							<span class="info-box-icon bg-warning elevation-1"><i class="fa fa-users"></i></span>

							<div class="info-box-content">
								<span class="info-box-text">中转订单</span>
								<span class="info-box-number" id="tos">0</span>
							</div>
							<!-- /.info-box-content -->
						</div>
						<!-- /.info-box -->
					</div>
					<!-- /.col -->
				</div>
				<!-- /.row -->

				<nav id="MyIframe">
					<!--包含总览页面-->
					<iframe width='100%' height='800px' frameborder='0' src="Pandect.html"></iframe>

				</nav>

			</div>
			<!-- /.content-wrapper -->
			<footer class="main-footer">
				<strong>Copyright &copy; 2014-2018 <a href="http://adminlte.io">AdminLTE.io</a>.</strong> All rights reserved.
				<div class="float-right d-none d-sm-inline-block">
					<b>Version</b> 3.0.0-alpha
				</div>
				<!-- Control Sidebar -->
				<aside class="control-sidebar control-sidebar-dark">
					<!-- Control sidebar content goes here -->
				</aside>
				<!-- /.control-sidebar -->
		</div>
		<!-- ./wrapper -->

		<!-- jQuery -->
		<script src="../../plugins/jquery/jquery.min.js"></script>
		<!-- jQuery UI 1.11.4 -->
		<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
		<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
		<script>
			$.widget.bridge('uibutton', $.ui.button)
		</script>
		<!-- Bootstrap 4 -->
		<script src="../../plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
		<!-- DataTables -->
		<link rel="stylesheet" href="../../plugins/datatables/dataTables.bootstrap4.css">
		<!-- Theme style -->
		<link rel="stylesheet" href="../../dist/css/adminlte.min.css">
		<!-- Morris.js charts -->
		<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
		<script src="../../plugins/morris/morris.min.js"></script>
		<!-- Sparkline -->
		<script src="../../plugins/sparkline/jquery.sparkline.min.js"></script>
		<!-- jvectormap -->
		<script src="../../plugins/jvectormap/jquery-jvectormap-1.2.2.min.js"></script>
		<script src="../../plugins/jvectormap/jquery-jvectormap-world-mill-en.js"></script>
		<!-- jQuery Knob Chart -->
		<script src="../../plugins/knob/jquery.knob.js"></script>
		<!-- daterangepicker -->
		<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
		<script src="../../plugins/daterangepicker/daterangepicker.js"></script>
		<!-- datepicker -->
		<script src="../../plugins/datepicker/bootstrap-datepicker.js"></script>
		<!-- Bootstrap WYSIHTML5 -->
		<script src="../../plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
		<!-- Slimscroll -->
		<script src="../../plugins/slimScroll/jquery.slimscroll.min.js"></script>
		<!-- FastClick -->
		<script src="../../plugins/fastclick/fastclick.js"></script>
		<!-- AdminLTE App -->
		<script src="../../dist/js/adminlte.js"></script>
		<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
		<script src="../../dist/js/pages/dashboard.js"></script>
		<!-- AdminLTE for demo purposes -->
		<script src="../../dist/js/demo.js"></script>
		<script src="../../js/login.js"></script>
		<script src="../../js/jquery.cookie.js"></script>
		<!-- page script -->
		<script>
			/*营业厅订单管理*/
			function showOrderManagement() {
				$("#MyIframe").empty();
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						if(data==200){
						$("#MyIframe").append("<iframe width='100%' height='800px'  frameborder='0' src='OrderManagement.html'></iframe>");
				        window.parent.dataFilling(); //调用父窗口函数更新报表
				       }else{
				       	alert("权限不足")
				       }
					}
				});
				
			}
			/*中转订单管理*/
			function showTransitofsingleOrderManagement() {
				$("#MyIframe").empty();
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						if(data==200){
				$("#MyIframe").append("<iframe width='100%' height='800px'  frameborder='0' src='TransitofsingleOrderManagement.html'></iframe>");
				        window.parent.dataFilling(); //调用父窗口函数更新报表
				       }else{
				       	alert("权限不足")
				       }
					}
				});
			}

			function show_Takestockofcargoinformation() {
				$("#MyIframe").empty();
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						if(data==200){
				$("#MyIframe").append("<iframe width='100%' height='800px'  frameborder='0' src='Takestockofcargoinformation.html'></iframe>");
				        window.parent.dataFilling(); //调用父窗口函数更新报表
				       }else{
				       	alert("权限不足")
				       }
					}
				});
			}
			/*查看中转单*/
			function Show_Transitofsingle() {
				$("#MyIframe").empty();
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						if(data==200){
				$("#MyIframe").append("<iframe width='100%' height='800px'  frameborder='0' src='Show_Transitofsingle.html'></iframe>");
				        window.parent.dataFilling(); //调用父窗口函数更新报表
				       }else{
				       	alert("权限不足")
				       }
					}
				});
			}
			/*查看装车单*/
			function Show_Tloading() {
				$("#MyIframe").empty();
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						if(data==200){
				$("#MyIframe").append("<iframe width='100%' height='800px'  frameborder='0' src='Show_Tloading.html'></iframe>");
				        window.parent.dataFilling(); //调用父窗口函数更新报表
				       }else{
				       	alert("权限不足")
				       }
					}
				});
			}
			/*查询寄件单*/
			function myCart(){
				$("#MyIframe").empty();
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						if(data==200){
				$("#MyIframe").append("<iframe id='iframe1' width='100%' height='800px'  frameborder='0' src='MyCart.html'></iframe>");
				        window.parent.dataFilling(); //调用父窗口函数更新报表
				       }else{
				       	alert("权限不足")
				       }
					}
				});
			}
			/*获得输入的寄件单号*/
			function getData(){
				return $("#search").val()
			}
			/*调用子窗口内的查询订单功能*/
			function showMyCart(sasid){
				$("#search").val(sasid)
				myCart();
			}
			//页面加载完成执行 （如果该客户端的 cookie 中有 账号和密码  则不用再登录了）
			$(function() {
				$.ajax({
					type: "post",
					url: "http://127.0.0.1:8075/login",
					xhrFields: {
						withCredentials: true
					},
					crossDomain: true,
					dataType: "json",
					data: {
						"username": 0,
						"password": 0,
						"status": "false"
					},
					success: function(msg) {
						if(msg != 0) {
							loginCookie();
						} else {
							//没有登录返回到登录页面    或者   给一个 弹框提示
							$(location).attr('href', '../LH_PM/UserLogin.html');
						}

					}
				})
			});

			function dataFilling() {
				//alert(hloading[hlid].hid.hname)
				//alert($("#goodsState"+hloading[hlid].hlid+"").val())//货物状态
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {
						withCredentials: true
					},
					crossDomain: true,
					url: "http://localhost:8073/dataFilling",
					dataType: "json", //跨域json请求一定是jsonp
					// jsonp: "callback", //跨域请求的参数名，默认是callback
					//jsonpCallback:"successCallback",    //自定义跨域参数值，回调函数名也是一样，默认为jQuery自动生成的字符串
					data: {
						sid:$.cookie("sid")
					}, //请求参数
					beforeSend: function() {
						//请求前的处理
						//alert("请求前")
					},
					success: function(data) {
						$("#pending").empty();
						$("#reached").empty();
						$("#arrive").empty();
						$("#tos").empty();
						$("#pending").append("" + data.pending + "<small>%</small>")
						$("#reached").append("" + data.reached + "")
						$("#arrive").append("" + data.arrive + "")
						$("#tos").append("" + data.tos + "")
						$("#d-block").empty()
						$("#d-block").append($.cookie("username"))
						//window.location.reload();
					},
					complete: function(data) {
						//请求完成的处理
						//alert(data)
						// alert("请求完成")

					},
					error: function() {
						window.location.replace("500.html");
					}
				});
			}
			dataFilling();
			/*test();
			function test(){
				$.ajax({
					type: "post", //请求方式
					async: true, //是否异步
					xhrFields: {withCredentials: true},
					crossDomain: true,
					url: "http://localhost:8073/test",
					dataType: "json", 
					success: function(data) {
						alert(data)
						//window.location.reload();
					}
				});
			}*/
		</script>
	</body>

</html>